export default function useDict(key?: string) {
  return useFetchApi(`/system/dict/${key}`, {
    transform: (data) => {
      return (data?.children || []).reduce((map, value) => {
        map.set(value.value, value.title);
        return map;
      }, new Map());
    },
  });
}
